﻿using jinmaMesProxy.Excep;

namespace jinmaMesProxy
{
    public static class ConfigReader
    {
        public static string ReadSetting(string section, string key)
        {
            try
            {
                var result = RuntimeVariable.GLOBAL_CONFIG.GetSection(section)[key];
                if (result == null)
                    throw new MyException($"无法找到{section}-{key}的参数值");
                return result.Trim();
            }
            catch (Exception ex)
            {
                throw new MyException(ex);
            }
        }
    }
}
